package 懒加载延时赋值

class Player4 {
    lateinit var equipment: String

    fun ready() {
        equipment = "sharp knife"
    }

    fun battle() {
        if (::equipment.isInitialized) {
            println(equipment)
        }
    }
}

fun main() {
    val player4 = Player4()
    player4.ready()
    player4.battle()
}